﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Medival_Snake
{
    class CollisionBuilder
    {

        public void CreateRect(int texIndex, int x, int y)
        {
            if (texIndex == 2)
            {
                Game1.Lvl1.Solids.Add(new Rectangle( //north 1
                                 x * Game1.Lvl1.TileWidth,
                                 y * Game1.Lvl1.TileHeight,
                                 Game1.Lvl1.TileWidth,
                                 Game1.Lvl1.TileHeight / Game1.Lvl1.TileHeight));
            }

            if (texIndex == 3)
            {
                Game1.Lvl1.Solids.Add(new Rectangle( //north 2
                                 x * Game1.Lvl1.TileWidth,
                                 y * Game1.Lvl1.TileHeight,
                                 Game1.Lvl1.TileWidth,
                                 Game1.Lvl1.TileHeight / Game1.Lvl1.TileHeight));
            }

            if (texIndex == 4)
            {
                Game1.Lvl1.Solids.Add(new Rectangle( //south
                                 x * Game1.Lvl1.TileWidth,
                                 y * Game1.Lvl1.TileHeight,
                                 Game1.Lvl1.TileWidth,
                                 Game1.Lvl1.TileHeight / Game1.Lvl1.TileHeight));
            }

            if (texIndex == 5)
            {
                Game1.Lvl1.Solids.Add(new Rectangle( //west
                                 x * Game1.Lvl1.TileWidth,
                                 y * Game1.Lvl1.TileHeight,
                                 Game1.Lvl1.TileWidth,
                                 Game1.Lvl1.TileHeight));
            }

            if (texIndex == 6)
            {
                Game1.Lvl1.Solids.Add(new Rectangle( // East
                                 x * Game1.Lvl1.TileWidth,
                                 y * Game1.Lvl1.TileHeight,
                                 Game1.Lvl1.TileWidth,
                                 Game1.Lvl1.TileHeight));
            }

            //8 > 19
            if (texIndex == 8)
            {
                Game1.Lvl1.Solids.Add(new Rectangle( // 8
                                 x * Game1.Lvl1.TileWidth,
                                 y * Game1.Lvl1.TileHeight,
                                 Game1.Lvl1.TileWidth,
                                 Game1.Lvl1.TileHeight));
            }

            if (texIndex == 9)
            {
                Game1.Lvl1.Solids.Add(new Rectangle( // 9
                                 x * Game1.Lvl1.TileWidth,
                                 y * Game1.Lvl1.TileHeight,
                                 Game1.Lvl1.TileWidth,
                                 Game1.Lvl1.TileHeight));
            }

            if (texIndex == 10)
            {
                Game1.Lvl1.Solids.Add(new Rectangle( //10
                                 x * Game1.Lvl1.TileWidth,
                                 y * Game1.Lvl1.TileHeight,
                                 Game1.Lvl1.TileWidth,
                                 Game1.Lvl1.TileHeight));
            }

            if (texIndex == 11)
            {
                Game1.Lvl1.Solids.Add(new Rectangle( //11
                                 x * Game1.Lvl1.TileWidth,
                                 y * Game1.Lvl1.TileHeight,
                                 Game1.Lvl1.TileWidth,
                                 Game1.Lvl1.TileHeight));
            }

            if (texIndex == 12)
            {
                Game1.Lvl1.Solids.Add(new Rectangle( //12
                                 x * Game1.Lvl1.TileWidth,
                                 y * Game1.Lvl1.TileHeight,
                                 Game1.Lvl1.TileWidth,
                                 Game1.Lvl1.TileHeight));
            }

            if (texIndex == 13)
            {
                Game1.Lvl1.Solids.Add(new Rectangle( //13
                                 x * Game1.Lvl1.TileWidth,
                                 y * Game1.Lvl1.TileHeight,
                                 Game1.Lvl1.TileWidth,
                                 Game1.Lvl1.TileHeight));
            }

            if (texIndex == 14)
            {
                Game1.Lvl1.Solids.Add(new Rectangle( //14
                                 x * Game1.Lvl1.TileWidth,
                                 y * Game1.Lvl1.TileHeight,
                                 Game1.Lvl1.TileWidth,
                                 Game1.Lvl1.TileHeight));
            }

            if (texIndex == 15)
            {
                Game1.Lvl1.Solids.Add(new Rectangle( //15
                                 x * Game1.Lvl1.TileWidth,
                                 y * Game1.Lvl1.TileHeight,
                                 Game1.Lvl1.TileWidth,
                                 Game1.Lvl1.TileHeight / Game1.Lvl1.TileHeight));
            }

            if (texIndex == 16)
            {
                Game1.Lvl1.Solids.Add(new Rectangle( //16
                                 x * Game1.Lvl1.TileWidth,
                                 y * Game1.Lvl1.TileHeight,
                                 Game1.Lvl1.TileWidth,
                                 Game1.Lvl1.TileHeight));
            }

            if (texIndex == 17)
            {
                Game1.Lvl1.Solids.Add(new Rectangle( //17
                                 x * Game1.Lvl1.TileWidth,
                                 y * Game1.Lvl1.TileHeight,
                                 Game1.Lvl1.TileWidth,
                                 Game1.Lvl1.TileHeight));
            }

            if (texIndex == 18)
            {
                Game1.Lvl1.Solids.Add(new Rectangle( //18
                                 x * Game1.Lvl1.TileWidth,
                                 y * Game1.Lvl1.TileHeight,
                                 Game1.Lvl1.TileWidth,
                                 Game1.Lvl1.TileHeight));
            }

            if (texIndex == 19)
            {
                Game1.Lvl1.Solids.Add(new Rectangle( //19
                                 x * Game1.Lvl1.TileWidth,
                                 y * Game1.Lvl1.TileHeight,
                                 Game1.Lvl1.TileWidth,
                                 Game1.Lvl1.TileHeight));
            }
        }
    }
}
